import request from '@/utils/request';

// 查询销售订单的list
export function listReturn(query) {
  const condition = {
    page:query.page,
    count:query.count,
    search:{
      rtvId:query.rtvId,
      orderId:query.orderId,
      rtvStatus: query.rtvStatus,
    }
  }
  return request({
    url: '/sales/return/query',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data:  JSON.stringify(condition)
  })
}

// 查询销售订单详情
export function getReturn(returnId) {
  return request({
    url: '/sales/return/' + returnId,
    method: 'get'
  })
}

export function updateReturn(query) {
    return request({
      url: '/sales/return/update',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data:  JSON.stringify(query)
    })
  }


// 删除退货订单信息
export function delReturn(query) {
  return request({
    url: '/sales/return/' + query,
    method: 'delete'
  })
}